package geektime.spring.springbucks.customerservice.integration;

import geektime.spring.springbucks.customerservice.model.Coffee;
import java.util.List;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;

@FeignClient(name = "my-waiter-service", contextId = "coffee",path = "/coffee")
//不要在接口上加@RequestMapping
public interface CoffeeService {

  @GetMapping(path = "/",params = "!name")
  List<Coffee> getAll();

  @GetMapping("/{id}")
  Coffee getById(@PathVariable(value = "id") Long id);

  @GetMapping(path = "/",params = "name")
  Coffee getByName(@RequestParam(value = "name") String name);
}
